<div class="uk-layui-form">
	<form class="layui-form uk-form" action="/admin/multitenant/user/update.html" method="post">
	  <input type="hidden" name="id" value="${userData.id!''}">
	  <input type="hidden" name="p" value="${p!''}">
	  <input type="hidden" name="tenantcode" value="${tenantcode!''}">
	  <div class="layui-form-item">
	    <label class="layui-form-label">用户名：</label>
	    <div class="layui-input-inline">
	      <input type="text" name="username" value="${userData.username!''}" required lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
	    </div>
	    <div class="layui-form-mid layui-word-aux">用户登录的账号</div>
	  </div>
	  <div class="layui-form-item">
	    <label class="layui-form-label">姓名：</label>
	    <div class="layui-input-inline">
	      <input type="text" name="uname" value="${userData.uname!''}" required lay-verify="required" placeholder="请输入用户姓名" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	  <div class="layui-form-item">
	    <label class="layui-form-label">电子邮件：</label>
	    <div class="layui-input-inline">
	      <input type="email" name="email" value="${userData.email!''}" required lay-verify="required email"  placeholder="请输入电子邮件地址" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	  <div class="layui-form-item">
	    <label class="layui-form-label">密码：</label>
	    <div class="layui-input-inline">
	      <input type="password" id="password" name="password" placeholder="请输入登录密码" lay-verify="pass" autocomplete="off" class="layui-input">
	    </div>
	    <div class="layui-form-mid layui-word-aux">
	    	<input type="password" id="repassword" name="repassword" lay-verify="repass" placeholder="请再次输入密码" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	  <div class="layui-form-item">
	    <label class="layui-form-label">手机号：</label>
	    <div class="layui-input-inline">
	      <input type="mobile" name="mobile" value="${userData.mobile!''}" required lay-verify="required|phone"  placeholder="请输入手机号码" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	  <#if user?? && user.superuser == true>
	  <div class="layui-form-item">
	    <label class="layui-form-label">管理员：</label>
	    <div class="layui-input-block">
	      <input type="checkbox" name="admin" lay-skin="switch" value="1" lay-filter="admincheckbox" lay-text="是|否"<#if userData.superuser>disabled</#if> <#if userData.usertype == "0">checked="checked"</#if>>
	    </div>
	  </div>
	  </#if>
	  <#if models?? && models["callcenter"]?? && models["callcenter"] == true>
	  <div class="layui-form-item">
	    <label class="layui-form-label">呼叫中心坐席：</label>
	    <div class="layui-input-inline">
	      <input type="checkbox" name="callcenter" lay-skin="switch" value="1" lay-text="开启|关闭" <#if userData?? && userData.callcenter == true>checked</#if>>
	    </div>
	    <div class="layui-input-inline">
	      <input type="checkbox" name="bindext" lay-filter="bindext" lay-skin="switch" value="1" <#if userData.bindext?? && userData.bindext == true>checked="checked"</#if> lay-text="启用分机绑定|禁用分机绑定">
	    </div>
	  </div>
	  <div class="layui-form-item" id="bindext_tip" style="<#if !(userData.bindext??) || userData.bindext == false>display:none</#if>">
	    <label class="layui-form-label">语音服务器：</label>
	    <div class="layui-input-inline">
	        <select name="hostid">
	        	<option value="">请选择语音服务器</option>
	        	<#if pbxHostList??>
	        	<#list pbxHostList as pbx>
	        	<option value="${pbx.id!''}" <#if userData.hostid?? && userData.hostid == pbx.id>selected="selected"</#if>>${pbx.name!''}</option>
	        	</#list>
	        	</#if>
	        </select>
	    </div>
	    <div class="layui-form-mid layui-word-aux" style="padding-top:5px !important;">
	    	<select name="extid">
	        	<option value="">请选择分机</option>
	        	<#if extentionList??>
	        	<#list extentionList as ext>
	        	<option value="${ext.id!''}" <#if userData.extid?? && userData.extid == ext.id>selected="selected"</#if>>${ext.extention!''}<#if ext.username??>（${ext.username!''}）</#if></option>
	        	</#list>
	        	</#if>
	        </select>
	    </div>
	  </div>
	  </#if>
	  <div class="layui-form-item"  id="agentDiv">
		  <div class="layui-form-item">
		    <label class="layui-form-label">多媒体坐席：</label>
		    <div class="layui-input-inline" style="width:100px;">
		      <input type="checkbox" name="agent" lay-skin="switch" value="1" lay-text="开启|关闭" <#if userData?? && userData.agent == true>checked</#if>>
		    </div>
		    <label class="layui-form-label max_tip" style="width:100px;<#if !(userData??) || userData.agent == false>display:none;</#if>padding-left:10px;">最大接入访客：</label>
		    <div class="layui-input-inline max_tip" style="width:150px;<#if !(userData??) || userData.agent == false>display:none;</#if>">
		      <select name="maxuser">
		      	<option value="0" <#if userData?? && userData.maxuser == 0>selected="selected"</#if>>默认</option>
		      	<option value="1" <#if userData?? && userData.maxuser == 1>selected="selected"</#if>>1</option>
		      	<option value="2" <#if userData?? && userData.maxuser == 2>selected="selected"</#if>>2</option>
		      	<option value="3" <#if userData?? && userData.maxuser == 3>selected="selected"</#if>>3</option>
		      	<option value="4" <#if userData?? && userData.maxuser == 4>selected="selected"</#if>>4</option>
		      	<option value="5" <#if userData?? && userData.maxuser == 5>selected="selected"</#if>>5</option>
		      	<option value="10" <#if userData?? && userData.maxuser == 10>selected="selected"</#if>>10</option>
		      	<option value="15" <#if userData?? && userData.maxuser == 15>selected="selected"</#if>>15</option>
		      	<option value="20" <#if userData?? && userData.maxuser == 20>selected="selected"</#if>>20</option>
		      	<option value="30" <#if userData?? && userData.maxuser == 30>selected="selected"</#if>>30</option>
		      </select>
		     </div>
		  </div>
	  </div>
	  <div class="layui-form-button">
	    <div class="layui-button-block">
	      <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
	      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
	    </div>
	  </div>
	</form>
</div>
 
<script>
//Demo
layui.use('form', function(){
  var form = layui.form;
  form.render(); //更新全部
  form.verify({
	  repass: function(value){
	    if(value != $('#password').val()){
	      return '两次输入的密码不一致，请确认';
	    }
	  }
	});
  form.on('switch(bindext)', function(data){
		if(data.elem.checked){
			$('#bindext_tip').show();
		}else{
			$('#bindext_tip').hide();
		}
	}); 
  form.on('switch(agent)', function(data){
		if(data.elem.checked){
			$('.max_tip').show();
		}else{
			$('.max_tip').hide();
		}
	}); 
});
</script>